cmake_minimum_required(VERSION 3.10)

project(riscv_sim_app VERSION 0.1 LANGUAGES C CXX)

set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_C_STANDARD 20)
set(CMAKE_C_STANDARD_REQUIRED ON)

if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
    message(STATUS "目标系统： Windows")
    set(SDL3_x86_64_INCLUDE_DIR
        E:/Project/RISCV/RISCV_SIM/libs/SDL3-3.2.20/x86_64-w64-mingw32/include
    )

    set(SDL3_x86_64_LIBRARY_DIR
        E:/Project/RISCV/RISCV_SIM/libs/SDL3-3.2.20/x86_64-w64-mingw32/lib
    )
elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux")
    message(STATUS "目标系统： Linux")
    set(SDL3_x86_64_INCLUDE_DIR
        ${CMAKE_CURRENT_SOURCE_DIR}/../../libs/SDL/SDL-release-3.2.20/include/
        ${CMAKE_CURRENT_SOURCE_DIR}/../../libs/SDL/SDL_ttf-release-3.2.2/include/
    )

    set(SDL3_x86_64_LIBRARY_DIR
        ${CMAKE_CURRENT_SOURCE_DIR}/../../libs/SDL/SDL-release-3.2.20/build
        ${CMAKE_CURRENT_SOURCE_DIR}/../../libs/SDL/SDL_ttf-release-3.2.2/build/
    )

else()
    message(STATUS "目标系统： ${CMAKE_SYSTEM_NAME} （未知）")
endif()

set(PROJECT_SOURCES
    ${CMAKE_CURRENT_SOURCE_DIR}/App/main.cpp
)

set(INCLUDE_DIR 
    ${CMAKE_CURRENT_SOURCE_DIR}/App
)

add_executable(${PROJECT_NAME} 
    ${PROJECT_SOURCES}
    App/AppConfigs.h
    Components/Widget/widget.h Components/Widget/widget.cpp
)

target_include_directories(${PROJECT_NAME} PUBLIC 
    ${INCLUDE_DIR}
    ${SDL3_x86_64_INCLUDE_DIR} 
)

target_link_libraries(${PROJECT_NAME} PRIVATE
    SDL3
    SDL3_ttf
)
